package com.atguigu.spzx.product.mapper;

import com.atguigu.spzx.model.dto.h5.ProductSkuDto;
import com.atguigu.spzx.model.entity.product.Product;
import com.atguigu.spzx.model.entity.product.ProductSku;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ProductSkuMapper {
    List<ProductSku> findProductSkusBySaleNum();

    List<ProductSku> findByPage(ProductSkuDto productSkuDto);

    ProductSku findSkuBySkuId(Long skuId);

    Product findProductBySpuId(Long productId);

    List<ProductSku> findAllSkuByProductId(Long productId);

    List<ProductSku> findSkusBySkuIds(List<Long> skuIds);

    boolean updateStockNumById(@Param("id")Long id,@Param("skuNum") Integer skuNum);
}
